﻿using System;
using System.Collections.Generic;

using System.Text;
using OpenCvSharp;

namespace RecognitionNumbers
{
    public class Gray : Filter
    {
        public Gray(IplImage image)
        {
            original = image;
            transformed = new IplImage(original.Size, BitDepth.U8, 1);
            Cv.CvtColor(original, transformed, ColorConversion.BgrToGray);
        }
    
        public void convert(IplImage image)
        {
            original = image;
            transformed = new IplImage(original.Size, BitDepth.U8, 1);
            Cv.CvtColor(original, transformed, ColorConversion.BgrToGray);
        }

        public override OpenCvSharp.IplImage input
        {
            get
            {
                return original;
            }
            set
            {
                original = value;
                transformed = new IplImage(original.Size, BitDepth.U8, 1);
                Cv.CvtColor(original, transformed, ColorConversion.BgrToGray);
            }
        }
    }
}
